package com.ericzong.util.file.excel;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Sheet;

public class ExcelUtils
{
	public static Cell getCellById(Sheet sheet, String cellId)
	{
		
		
		return null;
	}
	
	public static void checkCellId(String cellId)
	{
		Pattern pattern = Pattern.compile("[A-Z]+([0-9]+)");
		Matcher matcher = pattern.matcher(cellId);
		boolean isMatch = matcher.matches();
		
		if(isMatch)
		{
			String rowPart = matcher.group();
			int rowNumber = Integer.parseInt(rowPart);
			if(rowNumber > 0)
			{
				return;
			}
		}
		
		throw new ExcelCellIdFormatException(cellId);
	}
	
	public static int getRowNumberByCellId(String cellId)
	{
		
		return 0;
	}
	
	public static int getColumnNumberByCellId(String cellId)
	{
		
		return 0;
	}
}
